import * as vscode from 'vscode';




export class ExtensionService{
    private static _instance: ExtensionService;
    public readonly ExtensionContext: vscode.ExtensionContext;


    /**
     * 创建 StateService 的单例实例
     * @param context - vscode 扩展上下文
     */
    public static CreateInstance(context: vscode.ExtensionContext) {
        ExtensionService._instance = new ExtensionService(context);
    }


    // /**
    //  * 获取StateService的单例实例
    //  * @returns StateService的单例实例
    //  */
    // public static get Inst(): ExtensionService {
    //     return ExtensionService._instance;
    // }


    
    private constructor(context: vscode.ExtensionContext) {
        this.ExtensionContext = context;
    }


    public static get ExtensionPath(){
        return this._instance.ExtensionContext.extensionPath;
    }

    public static get ExtensionVersion(){
        return this._instance.ExtensionContext.extension.packageJSON.version;
    }
}